package com.settlement.system.model.entity.common;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.settlement.system.converter.*;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 【RR-费用分配权数】菜单 的 【操作记录】页签
 * @author xiaochuan
 * @since 2022-12-28
 */
@Data
@ExcelIgnoreUnannotated
@HeadStyle(fillBackgroundColor = 9,fillForegroundColor = 9)
@HeadRowHeight(value = 20)
@HeadFontStyle(fontHeightInPoints = 14)
public class TblCostWeightRecord extends BaseModel implements Serializable {


    /**
     * 操作时间
     */
    @ColumnWidth(20)
    @ExcelProperty(value = "操作时间",converter = DateTimeFormatConvert.class)
    @ApiModelProperty(value = "操作时间")
    @NotEmpty(message="操作时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 类型。1获取；2删除。
     */
    @ExcelProperty(value = "类型",converter = CostWeightRecordActionTypeConvert.class)
    @ApiModelProperty(value = "类型。1获取；2删除。")
    private String actionType;

    /**
     * 会计期间
     */
    @ColumnWidth(16)
    @ExcelProperty(value = "会计期间",converter = DateFormatYearMonthPeriodConvert.class)
    @ApiModelProperty(value = "会计期间")
    @JsonFormat(pattern = "yyyyMM月", timezone = "GMT+8")
    private Date accountingPeriod;

    /**
     * 渠道
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "渠道")
    @ApiModelProperty(value = "渠道")
    private String channelName;

    /**
     * 渠道编码
     */
    @ApiModelProperty(value = "渠道编码")
    private String channelNo;

    /**
     * 权数类型。1，当月发退货；2，近3月发货；
     */
    @ColumnWidth(16)
    @ExcelProperty(value = "权数类型",converter = WeightTypeConvert.class)
    @ApiModelProperty(value = "权数类型。1，当月发退货；2，近3月发货；")
    private String weightType;

    /**
     * 状态。1进行中；2已完成。
     */
    @ExcelProperty(value = "状态",converter = CostWeightRecordStatusConvert.class)
    @ApiModelProperty(value = "状态。1进行中；2已完成。")
    private String status;

    /**
     * 操作人
     */
    @ColumnWidth(13)
    @ExcelProperty(value = "操作人")
    @ApiModelProperty(hidden = true)
    public String createUser;

    /**
     * 完成时间
     */
    @ColumnWidth(22)
    @ExcelProperty(value = "完成时间")
    @ApiModelProperty(hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date updateTime;


    @Override
    public String toString() {
        return "TblCostWeightRecord{" +
                "actionType='" + actionType + '\'' +
                ", accountingPeriod=" + accountingPeriod +
                ", channelName='" + channelName + '\'' +
                ", channelNo='" + channelNo + '\'' +
                ", weightType='" + weightType + '\'' +
                ", status='" + status + '\'' +
                ", id='" + id + '\'' +
                ", createUser='" + createUser + '\'' +
                ", createTime=" + createTime +
                ", updateUser='" + updateUser + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }
}
